package com.zit.java.service.entrust;


import com.zit.java.dao.EntrustListMapper;
import com.zit.java.dao.EntrustStatusMapper;
import com.zit.java.pojo.EntrustList;
import com.zit.java.pojo.EntrustStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class EntrustServiceImpl implements EntrustService {

    @Autowired
    private EntrustListMapper mapper;

    @Autowired
    private EntrustStatusMapper statusMapper;

    /**
     * 查询所有的表数据
     *
     * @return
     */
    @Override
    public List<EntrustList> queryAllDate() {

        List<EntrustList> lsit = mapper.selectAllList();

        return lsit;
    }

    /**
     * 通过清单名查询
     *
     * @param listname
     * @return
     */
    @Override
    public List<EntrustList> queryDataByName(String listname) {
        List<EntrustList> list = mapper.selectByName(listname);
        return list;
    }

    /**
     * 查询所有数据映射为map集合
     *
     * @return
     */
    @Override
    public List<Map<String, String>> selectAllData() {
     List<Map<String,String>>  list =   mapper.selectAllData();
        return list;
    }

    @Override
    public List<EntrustStatus> queryAllErustStatus() {
        List<EntrustStatus> entrustStatuses = statusMapper.selectByExample(null);
        return entrustStatuses;
    }
}
